<template>
  <div class="footer-content">
    <div
      class="footer-main"
      :style="{
        width: settingStore.publicWidth,
      }"
    >
      <div class="footer-left">
        <div><span>友情链接：</span>
          <ul>
<!--            <a href="">北京石墨烯研究院</a></div>-->
            <li v-for="item in friendLinkList" :key="item.id">
              <a :href="item.url" target="_blank">{{ item.name }}</a>
            </li>
          </ul>
        </div>
        <div>
          <p>
            <span>地 址：</span>{{company_address}}
          </p>
        </div>
        <div>
          <p><span>电 话：</span>{{contact_phone}}</p>
        </div>
        <div>
          <p><span>邮 箱：</span>{{contact_email}}</p>
        </div>
        <div class="pc_ipc">北京石墨烯研究院 版权所有 <a class="text-color" href="https://beian.miit.gov.cn" target="_blank">{{version}}</a></div>
      </div>
      <div class="footer-right">
        <img :src="site_wechat" alt="" />
        <h4>官方微信</h4>
        <div class="phone_ipc">
          北京石墨烯研究院 版权所有 {{version}}
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { onMounted, ref } from "vue";
import { useSettingStore } from "@/store";
import { configKey, friendLink } from "@/api";
const settingStore = useSettingStore();
const friendLinkList = ref([]);
friendLink().then(e=> {
  friendLinkList.value = e;
})

const company_address = ref('');
configKey("company_address").then(e=> {
  company_address.value = e.configValue;
})
const contact_phone = ref('');
configKey("contact_phone").then(e=> {
  contact_phone.value = e.configValue;
})
const site_wechat = ref('');
configKey("site_wechat").then(e=> {
  site_wechat.value = e.image;
})
const contact_email = ref('');
configKey("contact_email").then(e=> {
  contact_email.value = e.configValue;
})
const version = ref('');
configKey("version").then(e=> {
  version.value = e.configValue;
})
</script>

<style lang="less" scoped>
.footer-content {
  width: 100%;
  height: 346px;
  background: url("@/assets/footer.png") no-repeat center;
  background-size: 100% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  .footer-main {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    .footer-left,
    .footer-right {
      font-size: 14px;
      width: 50%;
      height: 100%;
      color: #fff;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      span {
        word-spacing: 24px;
        margin-right: 10px;
      }
      a {
        color: #fff;
        text-decoration: underline;
      }
      img {
        width: 184px;
        height: 184px;
        margin-bottom: 20px;
      }
    }
    .footer-left {
      height: calc(100% - 40px);
    }
    .footer-right {
      align-items: center;
    }
    .pc_ipc {
      display: block;
    }
    .phone_ipc {
      display: none;
    }
  }
}
.@{starter-prefix}-footer {
  color: var(--td-text-color-placeholder);
  line-height: 20px;
  text-align: center;
}
@media screen and (max-width: 750px) {
  .footer-content {
    height: auto;
    padding: 30px 0;
    .footer-main {
      flex-direction: column;
      padding: 20px;
      .footer-left,
      .footer-right {
        width: 100%;
        height: auto;
        margin-bottom: 30px;
        span {
          margin-right: 5px;
          margin-bottom: 10px;
        }
        img {
          width: 120px;
          height: 120px;
          margin-bottom: 15px;
        }
      }
      .footer-left {
        height: auto;
        margin-bottom: 40px;
      }
      .pc_ipc {
        display: none;
      }
      .phone_ipc {
        display: block;
      }
    }
  }
}
</style>
